﻿using DotnetSpider;
using DSpider.Entities;
using DSpider.Utilities;
using OfficeOpenXml;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using Newtonsoft.Json;

namespace DSpider
{
    class Program
    {
        static void Main(string[] args)
        {
            var ss = new NewsUrl()
            {
                Xpath = @"//*[@id=""v_news""]/div[1]/div[3]/div[1]/a"
            };
            var strin = JsonConvert.SerializeObject(ss);
            
            using (var filestream = new FileStream(@"D:\cxc\docs\urls.xlsx", FileMode.Open))
            {
                using (var package = new ExcelPackage(filestream))
                {
                    var urls = Tools.readExcelPackageToString<List<NewsUrl>>(package, 0);
                }
            }

            Console.WriteLine("Hello World!");
            Startup.Execute<NewsSpider>(args);
            Console.ReadKey();
        }
    }
}
